<?php
/**
 * Created by PhpStorm.
 * User: fyl
 * Date: 2016/8/13
 * Time: 11:06
 */

class Involved_MaterialModel extends BaseModel{

    protected $table = 'material';



    /**
     * 获取材质列表
     * @author fyl
     * @date 2016-08-13
     */
    public function AdminProductMaterialList()
    {
        return DB::table($this->table)
            ->select('m_id','m_name','m_remarks')
            ->get();
    }

    /**
     * @param $m_name
     * @return mixed
     */
    public function ProductMaterialIs($m_name)
    {
        return DB::table($this->table)
            ->select('m_id')
            ->where('m_name',$m_name)
            ->first();
    }


    /**
     * 根据ID获取产品详情
     * @return mixed
     */
    public function GetProductMaterialById1($id)
    {
        return  DB::table($this->table)
            ->where('m_id',$id)
            ->first();
    }

    /**
     * 获取材质下拉菜单
     * @author fyl
     * @date 2016-08-13
     */
    public function SelectMaterial()
    {
        return DB::table($this->table)
            ->select('m_id','m_name')
            ->get();
    }

}